<!DOCTYPE html>
<html lang='zh-CN'>
    <head>
        <meta charset='utf-8'>
        <meta name='viewport' content='maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,width=device-width,initial-scale=1.0'/>
        <link rel='stylesheet' type='text/css' href='module.css' />
		<style type='text/css'>
		  .diy-btn-group-test {margin : 10px 0px 0px 0px;}
          body{-webkit-user-select:none;}
		</style>
    </head>
    <body>
<div class="panel panel-info">
  <div class="panel-heading">
    <h3 class="panel-title">open 打开百度地图</h3>
  </div>
  <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.open({
    x: 0,  // 横坐标.
    y: 0, // 纵坐标.
    width: api.frameWidth, // 宽度.
    height: api.frameHeight / 3.0, // 高度.
    lon: 112.45782, // 初始经度.
    lat: 34.61991, // 初始纬度
    fixedOn: api.frameName // 父视图.
},function(ret,err){ // 回调函数.
    var msg = "百度地图打开成功";

    if( ! ret.status){
        msg = "百度地图出错了";
    }

     api.toast({
            msg: msg,
            duration: 1000,
            location: "top"
            });
});
	</pre>
</div>
<div class="panel-footer">	
	<div class="btn-group btn-group-justified">
	  <div class="btn-group">
	    <button role="run" type="button" class="btn btn-primary">运行</button>
	  </div>	  
	  <div class="btn-group">
	    <button  role="edit" type="button" class="btn btn-info">编辑</button>
	  </div>
	  <div class="btn-group">
	    <button  role="restore" type="button" class="btn btn-warning">还原</button>
	  </div>
	</div>
</div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">close 关闭百度地图</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.close();
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">setType 设置百度地图类型</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');
map.setType({
    mapType:'trafficOn' // 地图类型,可选: standard,标准地图;trafficOn, 实时路况; trafAndsate, 实时路况和卫星地图;satellite, 卫星地图
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">startLocation 开始定位</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var baiduMap = api.require('baiduMap');

baiduMap.startLocation({
    accuracy: '100m', // 定位精度,可选: 10m, 100m, 1km, 3km
    filter:1, // 更新距离所需最小距离,单位米.
    autoStop: true // 获取到位置信后,是否自动停止定位.
},function(ret, err){ // 回调函数.
    if(ret && ret.longitude){
        api.alert({
            title: "定位结果",
            msg: "经度:" + ret.longitude + " \n纬度: " + ret.latitude + "\n 时间戳:" + ret.timestamp
            });
    }else{
        api.alert({
            title: "定位结果",
            msg: "定位失败"
            });
    }
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">stopLocation 停止定位</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var baiduMap = api.require('baiduMap');
baiduMap.stopLocation();
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">getLocation 获取位置信息</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var baiduMap = api.require('baiduMap');

baiduMap.getLocation(
    function(ret, err){ // 回调函数.
        if(ret && ret.longitude){
            api.alert({
                title: "定位结果",
                msg: "经度:" + ret.longitude + " \n纬度: " + ret.latitude + "\n 时间戳:" + ret.timestamp
            });
        }else{
            api.alert({
                title: "定位结果",
                msg: "定位失败"
            });
        }
    }
);
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">getBaiduFromGoogle 将谷歌坐标转换为百度坐标</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');
map.getBaiduFromGoogle ({
    lon:112.45782, //  经度
    lat:34.61991 // 纬度
}, function(ret, err){ // 回调函数.
    if(ret && ret.lon){
        api.alert({
            title: "百度坐标",
            msg: "经度:" + ret.lon + " \n纬度: " + ret.lat
        });
    }else{
        api.alert({
            title: "定位结果",
            msg: "定位失败"
        });
    }
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">setCenter 设置百度地图中心点</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.setCenter({
    lon:116.38429, // 经度
    lat:39.98958 // 纬度
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">setZoomLevel 设置百度地图缩放等级</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.setZoomLevel({
    level:3 // 地图比例尺级别,当前手机可用 3 - 18级.
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">setZoomEnable 设置百度地图是否允许缩放</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.setZoomEnable({
    enable:false // true,允许缩放;false, 不支持缩放.
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">setScrollEnable 设置百度地图是否能够滚动</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');
map.setScrollEnable({
    enable:false // true, 可以滚动;false,不可以滚动.
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">setHidden 设置是否隐藏地图</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.setHidden({
    hidden:false // true,隐藏; false,不隐藏.
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">showUserLocation 设置是否在地图上显示用户位置</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.showUserLocation({
    isShow:true, // true,显示用户位置;false,不显示用户位置.
    trackingMode:'compass' // 跟踪类型,可选: none,标准模式; follow, 跟踪模式; compass, 罗盘模式.
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">zoomOut 缩小视角</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.zoomOut();
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">zoomIn 放大视角</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.zoomIn();
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">addAnnotations 在地图上添加大头针</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

var annoArray = [
    {
        id:1,
        lon:112.47723797622677,
        lat:34.556480000000015,
        title:'龙门石窟',
        subTitle:'中国四大石窟之一'
    },
    {
        id:2,
        lon: 109.77539000000002,
        lat: 33.43144,
        title:'白马寺',
        subTitle:'释源'
    },
    {
        id:3,
        lon: 111.57062599999995,
        lat: 33.784214,
        title:'鸡冠洞',
        subTitle:'龙蛇之窟'
    }
];

map.addAnnotations({
    annoArray:annoArray
},function(ret,err){
    if(ret && ret.bubbleID){
        var item = annoArray[ret.bubbleID - 1];
        var msg = "默认大头针点击事件: " + item.subTitle + " " + item.title;

        api.alert({
            title: "温情提示",
            msg: msg
        });
    }

    if(ret && ret.cbBubbleID){
        var item = annoArray[ret.cbBubbleID - 1];
        var msg = "自定义大头针事件: " + item.subTitle + " " + item.title;

        api.alert({
            title: "温情提示",
            msg: msg
        });
    }
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">setBubbleStyle 设置大头针上气泡的类型</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');
map.setBubbleStyle({
    id:1,
    bubbleBgimg:'widget://image/baiduMap/bubble_bg.png',
    imgPath:'widget://image/baiduMap/bubble_head.png'
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">addMarks 在地图上添加布告牌</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

var annoArray = [
    {
        id:1,
        lon:112.47723797622677,
        lat:34.556480000000015,
        title:'龙门石窟',
        subTitle:'中国四大石窟之一'
    },
    {
        id:2,
        lon: 109.77539000000002,
        lat: 33.43144,
        title:'白马寺',
        subTitle:'释源'
    },
    {
        id:3,
        lon: 111.57062599999995,
        lat: 33.784214,
        title:'鸡冠洞',
        subTitle:'龙蛇之窟'
    }
];

map.addMarks ({
    marks:annoArray
},function(ret,err){
    if(ret && ret.markID){
        var item = annoArray[ret.markID - 1];
        var msg = "您点击了 " + item.subTitle + " " + item.title;

        api.alert({
            title: "温情提示",
            msg: msg
        });
    }
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">setMarkStyle 设置布告牌的类型</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.setMarkStyle ({
    id: 1, // 布告牌 id.
    bgImg:'widget://image/baiduMap/mark_bg_test.png', // 布告牌背景图.
    headImg:'widget://image/baiduMap/mark_test.png' // 布告牌头像.
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">removeAnnotations 移除指定id的大头针或布告牌</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.removeAnnotations({
    idArray:[1] // 数组,所有要移除的大头针或布告牌的id.
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">addLine 在地图上添加线</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.addLine({
    style:{
        id:100, // 线的 id.
        fillColor:'#FF0000', // 线的填充色.
        strokeColor:'#990033', // 线的边框色.
        lineWidth: 5 // 线的宽度.
    },
    pointArray:[
        {
            lon: 112.47723797622677, // 点的经度.
            lat: 34.556480000000015 // 点的纬度.
        },
        {
            lon: 109.77539000000002, // 点的经度.
            lat: 33.43144 // 点的纬度.
        },
        {
            lon: 111.57062599999995, // 点的经度.
            lat: 33.784214 // 点的纬度.
        }]
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">addPolygon 在地图上添加多边形</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.addPolygon ({
    style:{
        id:100, // 线的 id.
        fillColor:'#FF0000', // 线的填充色.
        strokeColor:'#990033', // 线的边框色.
        lineWidth: 5 // 线的宽度.
    },
    pointArray:[
        {
            lon: 112.47723797622677, // 点的经度.
            lat: 34.556480000000015 // 点的纬度.
        },
        {
            lon: 109.77539000000002, // 点的经度.
            lat: 33.43144 // 点的纬度.
        },
        {
            lon: 111.57062599999995, // 点的经度.
            lat: 33.784214 // 点的纬度.
        }]
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">addCircle 在地图上添加圆圈</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.addCircle({
    id: 1, // 圆圈的 id.
    lon: 112.45782, // 圆心经度.
    lat: 34.61991, // 圆心纬度.
    radius:500, // 圆的半径.
    fillColor:'#FF0000', // 圆圈的填充色.
    strokeColor:'#990033',// 圆圈的边框色.
    lineWidth: 5 // 线的宽度.
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">addOverMark 在地图上添加图片</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.addOverMark({
    id:1, // id.
    lbLon: 112.47723797622677, // 左下角经度.
    lbLat: 34.556480000000015, // 左下角纬度.
    rtLon: 109.77539000000002, // 右上角经度.
    rtLat: 33.43144, // 右上角纬度.
    imgPath:'widget://image/logo.png' // 图片路径.
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">removeOverlay 移除指定id的覆盖物</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.removeOverlay({
    idArray:[1] // 数组, 存储要移除的覆盖物的 id.
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">addRoute 添加路线</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.addRoute({
    id: 1, // 路线 id.
    type:'drive', // 路线类型,可选: drive 开车，transit 公交，walk 步行
    startPoint:{
        city:'洛阳', // 起点城市.
        name:'龙门石窟' // 起点名, 和经纬度配合使用，有经纬度时，此参数可为空
    },
    endPoint:{
        city:'洛阳',
        lon: 111.57062599999995, // 终点经度, 和终点名配合使用，有终点名时，此参数可为空
        lat: 33.784214 // 终点纬度, 和终点名配合使用，有终点名时，此参数可为空
    }
},function(ret,err){
    if(ret.status){
        api.alert({
            title: "路线详情",
            msg: JSON.stringify(ret.steps)
        });
    } else{
        api.alert({
            title: "路线添加失败",
            msg: err.msg
        });
    }
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">removeRoute 移除指定id的路线</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.removeRoute({
    idArray:[1] // 数组,存储要移除的路线的 id.
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">searchInCity 根据关键字搜索兴趣点</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.searchInCity({
    city: "洛阳", // 城市名,在此城市内进行搜索.
    key: "大学", // 关键字.
    index: 0 // 页码,根据返回的结果可以去获取第n页的结果
},function(ret,err){
    if( ! ret.status){
        api.alert({
            title: "出错了",
            msg: err.msg
        });
    }else{
        var msg = "总结果数: " + ret.totalNum +
            "\n当前页结果数: " + ret.curNum +
            "\n本次搜索的总页数: " + ret.totalPage +
            "\n当前页的索引: " + ret.pageIndex +
            "\n搜索结果: " + JSON.stringify(ret.resultArray);

        api.alert({
            title: "搜索结果",
            msg: msg
        });
    }
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">searchNearBy 根据单个关键字在指定圆圈区域内搜索兴趣点</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.searchNearBy({
    key:'图书馆', // 要搜索的关键字.
    lon:112.45782, // 中心点经度.
    lat:34.61991, // 中心点纬度.
    radius:20000, // 区域半径,单位 m.
    pageIndex:0 // 页码,根据返回的结果可以去获取第n页的结果
},function(ret,err){
    if( ! ret.status){
        api.alert({
            title: "出错了",
            msg: err.msg
        });
    }else{
        var msg = "总结果数: " + ret.totalNum +
            "\n当前页结果数: " + ret.curNum +
            "\n本次搜索的总页数: " + ret.totalPage +
            "\n当前页的索引: " + ret.pageIndex +
            "\n搜索结果: " + JSON.stringify(ret.resultArray);

        api.alert({
            title: "搜索结果",
            msg: msg
        });
    }
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">searchInBounds 根据单个关键字在指定方形区域内搜索兴趣点</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.searchInBounds({
    key: '图书馆', // 要搜索的关键字.
    lbLon: 112.47723797622677, // 左下角经度.
    lbLat: 34.556480000000015, // 左下角纬度.
    rtLon: 109.77539000000002, // 右上角经度.
    rtLat: 33.43144, // 右上角纬度.
    pageIndex:0 // 获取返回结果中第n页的结果
},function(ret,err){
    if( ! ret.status){
        api.alert({
            title: "出错了",
            msg: err.msg
        });
    }else{
        var msg = "总结果数: " + ret.totalNum +
            "\n当前页结果数: " + ret.curNum +
            "\n本次搜索的总页数: " + ret.totalPage +
            "\n当前页的索引: " + ret.pageIndex +
            "\n搜索结果: " + JSON.stringify(ret.resultArray);
        api.alert({
            title: "搜索结果",
            msg: msg
        });
    }
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">getLocationFromName 根据地址查找经纬度</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.getLocationFromName({
    city:'洛阳', // 城市名.
    address:'龙门石窟' // 位置.
},function(ret,err){
    if (ret.status){
        var msg = "经度: " + ret.lon +
                 "\n 纬度: " + ret.lat;

        api.alert({
            title:'搜索结果',
            msg: msg
        });
    } else{
        api.alert({
            title: '错误代码',
            msg: err.msg
        });
    }
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">getNameFromLocation 根据经纬度查找地址信息</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.getNameFromLocation({
    lon:116.384767, // 经度.
    lat:39.989539 // 纬度.
},function(ret,err){
    if (ret.status){
        var msg = "经度: " + ret.lon +
            "\n纬度: " + ret.lat +
            "\n地址: " + ret.add +
            "\n省份: " + ret.province +
            "\n城市: " + ret.city +
            "\n县区: " + ret.district +
            "\n街道名: " + ret.streetName+
            "\n街道号: " + ret.streetNumber;

        api.alert({
            title:'搜索结果',
            msg: msg
        });
    } else{
        api.alert({
            title: '搜索错误代码',
            msg: err.msg
        });
    }
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">getBusRouteFromLineNum 根据公交线路号查询详情并在地图上显示</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.getBusRouteFromLineNum({
    city:'北京', // 城市.
    line:'625' // 公交编号.
},function(ret,err){
    if (ret.status){
        var msg = "公交名字: " + ret.busName +
            "\n公交公司: " + ret.company +
            "\n最早发车时间: " + ret.startTime +
            "\n最晚班车时间: " + ret.endTime +
            "\n子站点: " + JSON.stringify(ret.stepInfo);

        api.alert({
            title: '搜索结果',
            msg: msg
        });
    } else{
        api.alert({
            title: '搜索错误代码',
            msg: err.msg
        });
    }
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">removeBusRoute 移除地图上查询的公交线路</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.removeBusRoute();
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>

<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">longPressGesture 在地图上添加长按手势，长按返回该点经纬度</h3>
    </div>
    <div class="panel-body">
		<pre class="pre-scrollable">
var map = api.require('baiduMap');

map.longPressGesture(function(ret,err){
    var msg  = "经度: " + ret.lon +
        "\n纬度: " + ret.lat;

    api.alert({
        title: "结果",
        msg: msg
    });
});
	</pre>
    </div>
    <div class="panel-footer">
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <button role="run" type="button" class="btn btn-primary">运行</button>
            </div>
            <div class="btn-group">
                <button  role="edit" type="button" class="btn btn-info">编辑</button>
            </div>
            <div class="btn-group">
                <button  role="restore" type="button" class="btn btn-warning">还原</button>
            </div>
        </div>
    </div>
</div>
    </body>
    <script src="jquery-1.11.1.min.js"></script>
    <script src='highlight.pack.js'></script>
    <script src='module.js'></script>
</html>